package com.mongodb.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * @author xiaochi
 * @date 2022/8/16 9:46
 * @desc GroupEntity
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document("t_group")
public class GroupEntity {

    @Id
    private String id;

    private String groupId;

    private String head;

    private String name;

    /**
     * 最后发送者Id
     */
    @Indexed
    @Field("last_form")
    private String lastForm;

    @Field("last_head")
    private String lastHead;

    @Field("last_message")
    private String lastMessage;

    @Field("last_message_type")
    private Integer lastMessageType;

    @Indexed
    @Field("create_user")
    private String createUser;

    @Field("create_user_head")
    private String createUserHead;

    @Field("create_user_name")
    private String createUserName;

    @Field("create_time")
    private String createTime;

    @Field("update_time")
    private String updateTime;

    @Transient
    private Integer type;
}
